import request from '@/utils/request'

// 查询考点盟市信息列表
export function listCity(query) {
  return request({
    url: '/baoming/city/list',
    method: 'get',
    params: query
  })
}

// 查询考点盟市信息详细
export function getCity(id) {
  return request({
    url: '/baoming/city/' + id,
    method: 'get'
  })
}

// 新增考点盟市信息
export function addCity(data) {
  return request({
    url: '/baoming/city',
    method: 'post',
    data: data
  })
}

// 修改考点盟市信息
export function updateCity(data) {
  return request({
    url: '/baoming/city',
    method: 'put',
    data: data
  })
}

// 删除考点盟市信息
export function delCity(id) {
  return request({
    url: '/baoming/city/' + id,
    method: 'delete'
  })
}

// 导入excel文件，批量新增考点盟市信息
export function importCity(data) {
  const formData = new FormData();
  formData.append('file', data);

  return request({
    url: '/baoming/city/importData',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

